/**
 * @Author:Geln Yang
 * @Created:2008-8-21
 * $ Revision: 1.0 $
 * $ Author: Geln Yang $
 * $ Date: 2008-8-21 $
 */
package org.geln.web.status;

/**
 * @Author:Geln Yang
 * @Created:2008-8-21
 */
public class Status {
	private String code;
	public static Status ERROR = new Status("E000000");
	public static Status ERROR_REF = new Status("E000001");
	
	public static Status SUCCESS = new Status("S000000");

	public static Status FAILED = new Status("F000000");
	public static Status FAILED_FOR_NULL = new Status("F000001");
	
	public static Status NULL = new Status("N000000");

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((code == null) ? 0 : code.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final Status other = (Status) obj;
		if (code == null) {
			if (other.code != null)
				return false;
		} else if (!code.equals(other.code))
			return false;
		return true;
	}

	private Status(String code) {
		this.code = code;
	}

	@Override
	public String toString() {
		return this.code;
	}

}
